package top.springcloud.customer.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @ClassName TestController
 * @Description TODO
 * @Author 维康
 * @Date 2018/11/16 14:23
 * @Version 1.0
 **/
@RestController
@RequestMapping("/get")
public class TestController {


    @RequestMapping("/message")
    public void message(HttpServletResponse response) throws IOException {
        PrintWriter out = response.getWriter();
        while (true){
            out.write("test");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
